package com.cykj.shop.service.impl;

/**
 * @BelongsProject: Cykj-Order-System
 * @BelongsPackage: com.cykj.shop.service.impl
 * @Author: cwx
 * @CreateTime: 2025/9/1 2:42
 * @Description:
 * @Version: 1.0
 */
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cykj.shop.domain.vo.BsAppraise;
import com.cykj.shop.mapper.BsAppraiseMapper;
import com.cykj.shop.service.BsAppraiseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 评价表 服务实现类
 * </p>
 *
 * @author
 * @since
 */
@Service
public class BsAppraiseServiceImpl extends ServiceImpl<BsAppraiseMapper, BsAppraise> implements BsAppraiseService {

    @Resource
    private BsAppraiseMapper bsAppraiseMapper;

    /**
     * 根据店铺ID查询评价列表
     * @param shopId 店铺ID
     * @return 评价列表
     */
    @Override
    public List<BsAppraise> getAppraisesByShopId(Long shopId) {
        if (shopId == null || shopId <= 0) {
            throw new IllegalArgumentException("店铺ID不能为空或小于等于0");
        }
        return bsAppraiseMapper.selectByShopId(shopId);
    }
}
